package com.zh.service.Imp;

import com.zh.dao.AccountDao;
import com.zh.service.transferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(propagation = Propagation.REQUIRED)
public class transferServiceImp implements transferService {
    @Autowired
    private AccountDao accountDao;

    @Override
    public void transfer(String user1,String user2,String password) {
        accountDao.inMoney(user1,user2,password);
        int a= 1/0;
        accountDao.outMoney(user1,user2,password);
    }
}
